<?php

namespace app\common;

enum PayType: int
{
    case PAY_ALIPAY = 1;
    case PAY_WECHAT = 2;
    case PAY_APPLEPAY = 3;

    public function getStatus(): string
    {
        return match ($this) {
            self::PAY_ALIPAY => '支付宝支付',
            self::PAY_WECHAT => '微信支付',
            self::PAY_APPLEPAY => '苹果支付',
        };
    }

    public static function values(): array
    {
        $notes = [];
        $array = array_column(self::cases(), 'value');
        foreach ($array as $value) {
            $notes[$value] = self::from($value)->getStatus();
        }
        return $notes;
    }
}